{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "package test.beakerx;\n",
    "\n",
    "import java.util.Collection;\n",
    "import java.util.Iterator;\n",
    "import java.util.List;\n",
    "import java.util.ListIterator;\n",
    "import java.util.ArrayList;\n",
    "import org.apache.commons.lang3.builder.EqualsBuilder;\n",
    "import org.apache.commons.lang3.builder.HashCodeBuilder;\n",
    "\n",
    "public class BeakerTest<E> implements List<E> {\n",
    "\n",
    "  List<E> orig;\n",
    "\n",
    "  public BeakerTest(List<E> orig) {\n",
    "    this.orig = orig;\n",
    "  }\n",
    "\n",
    "  @Override\n",
    "  public int size() {\n",
    "    return orig.size();\n",
    "  }\n",
    "\n",
    "  @Override\n",
    "  public boolean isEmpty() {\n",
    "    return orig.isEmpty();\n",
    "  }\n",
    "\n",
    "  @Override\n",
    "  public boolean contains(Object o) {\n",
    "    return orig.contains(o);\n",
    "  }\n",
    "\n",
    "  @Override\n",
    "  public Iterator<E> iterator() {\n",
    "    return orig.iterator();\n",
    "  }\n",
    "\n",
    "  @Override\n",
    "  public Object[] toArray() {\n",
    "    return orig.toArray();\n",
    "  }\n",
    "\n",
    "  @Override\n",
    "  public <T> T[] toArray(T[] a) {\n",
    "    return orig.toArray(a);\n",
    "  }\n",
    "\n",
    "  @Override\n",
    "  public boolean add(E e) {\n",
    "    return orig.add(e);\n",
    "  }\n",
    "\n",
    "  @Override\n",
    "  public boolean remove(Object o) {\n",
    "    return orig.remove(o);\n",
    "  }\n",
    "\n",
    "  @Override\n",
    "  public boolean containsAll(Collection<?> c) {\n",
    "    return orig.containsAll(c);\n",
    "  }\n",
    "\n",
    "  @Override\n",
    "  public boolean addAll(Collection<? extends E> c) {\n",
    "    return orig.addAll(c);\n",
    "  }\n",
    "\n",
    "  @Override\n",
    "  public boolean addAll(int index, Collection<? extends E> c) {\n",
    "    return orig.addAll(index, c);\n",
    "  }\n",
    "\n",
    "  @Override\n",
    "  public boolean removeAll(Collection<?> c) {\n",
    "    return orig.removeAll(c);\n",
    "  }\n",
    "\n",
    "  @Override\n",
    "  public boolean retainAll(Collection<?> c) {\n",
    "    return orig.retainAll(c);\n",
    "  }\n",
    "\n",
    "  @Override\n",
    "  public void clear() {\n",
    "    orig.clear();\n",
    "  }\n",
    "\n",
    "  @Override\n",
    "  public E get(int index) {\n",
    "    return orig.get(index);\n",
    "  }\n",
    "\n",
    "  @Override\n",
    "  public E set(int index, E element) {\n",
    "    return orig.set(index, element);\n",
    "  }\n",
    "\n",
    "  @Override\n",
    "  public void add(int index, E element) {\n",
    "    orig.add(index, element);\n",
    "  }\n",
    "\n",
    "  @Override\n",
    "  public E remove(int index) {\n",
    "    return orig.remove(index);\n",
    "  }\n",
    "\n",
    "  @Override\n",
    "  public int indexOf(Object o) {\n",
    "    return orig.indexOf(o);\n",
    "  }\n",
    "\n",
    "  @Override\n",
    "  public int lastIndexOf(Object o) {\n",
    "    return orig.lastIndexOf(o);\n",
    "  }\n",
    "\n",
    "  @Override\n",
    "  public ListIterator<E> listIterator() {\n",
    "    return orig.listIterator();\n",
    "  }\n",
    "\n",
    "  @Override\n",
    "  public ListIterator<E> listIterator(int index) {\n",
    "    return orig.listIterator(index);\n",
    "  }\n",
    "\n",
    "  @Override\n",
    "  public List<E> subList(int fromIndex, int toIndex) {\n",
    "    return orig.subList(fromIndex, toIndex);\n",
    "  }\n",
    "    \n",
    "  @Override\n",
    "  public String toString() {\n",
    "    return \"myToString method\";\n",
    "  }\n",
    "        \n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "package test.beakerx;\n",
    "\n",
    "return BeakerTest.class.hashCode();"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "package test.beakerx;\n",
    "return BeakerTest.class.hashCode();"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "package test.beakerx;\n",
    "import java.util.Arrays;\n",
    "import java.util.ArrayList;\n",
    "return new BeakerTest<Integer>(Arrays.asList(1,2,3,5,8,13,21));"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import jupyter.Displayer;\n",
    "import jupyter.Displayers;\n",
    "import java.util.HashMap;\n",
    "import java.util.Map;\n",
    "import com.twosigma.beakerx.mimetype.MIMEContainer;\n",
    "import test.beakerx.BeakerTest;\n",
    "\n",
    "Displayers.register(BeakerTest.class, new Displayer<BeakerTest>() {\n",
    "      @Override\n",
    "      public Map<String, String> display(BeakerTest value) {\n",
    "        return new HashMap<String, String>() {{\n",
    "          put(MIMEContainer.MIME.TEXT_HTML, \"<div><h1>\" + \"From Displayers: \" +value.toString() + \"</h1></div>\");\n",
    "          \n",
    "        }};\n",
    "      }\n",
    "    });"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "package test.beakerx;\n",
    "\n",
    "import java.util.Arrays;\n",
    "import java.util.ArrayList;\n",
    "return new BeakerTest<Integer>(Arrays.asList(1,2,3,5,8,13,21));"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Java",
   "language": "java",
   "name": "java"
  },
  "language_info": {
   "codemirror_mode": "text/x-java",
   "file_extension": ".java",
   "mimetype": "",
   "name": "Java",
   "nbconverter_exporter": "",
   "version": "1.8.0_121"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
